﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EMS
{
    public partial class Default : DevExpress.XtraEditors.XtraForm
    {
        delegate void closeFormDelegate();
        closeFormDelegate myDelegate;
        System.Timers.Timer time = new System.Timers.Timer(3000);
        public Default()
        {
            InitializeComponent();
            DevExpress.Skins.SkinManager.EnableFormSkins();
            DevExpress.UserSkins.BonusSkins.Register();
            myDelegate = new closeFormDelegate(CloseForm);
        }

        private void Default_Load(object sender, EventArgs e)
        {
            time.Elapsed += time_Elapsed;
            time.AutoReset = false;
            time.Enabled = true;
        }

        void time_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            Invoke(myDelegate);
        }

        private void CloseForm()
        {
            time.Close();
            this.Hide();
            Home homeFrm = new Home();
            homeFrm.Show();
        }
    }
}
